package com.yidu.hbatsams.dao;

import com.yidu.hbatsams.domain.AtsPlanWeek;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AtsPlanWeekMapper {
    /**
     * 查询所有
     *
     * @param atsPlanWeek
     * @return
     */
    List<AtsPlanWeek> selectAll(AtsPlanWeek atsPlanWeek);
    List<AtsPlanWeek> findAll(AtsPlanWeek atsPlanWeek);
    List<AtsPlanWeek> findCoach(AtsPlanWeek atsPlanWeek);
    List<AtsPlanWeek> findAthlete(AtsPlanWeek atsPlanWeek);

    /**
     * 查询总行数
     *
     * @param atsPlanWeek
     * @return
     */
    int countAll(AtsPlanWeek atsPlanWeek);
    int countWeekAll(AtsPlanWeek atsPlanWeek);
    int countCoach(AtsPlanWeek atsPlanWeek);
    int countAthlete(AtsPlanWeek atsPlanWeek);

    /**
     * 删除
     *
     * @param weekId
     * @return
     */
    int isvaDel(Integer weekId);

    /**
     * id查询
     *
     * @param weekId
     * @return
     */
    AtsPlanWeek findById(Integer weekId);


    int insertSelectiveFour(AtsPlanWeek record);

    int updateByPrimaryKeySelectiveFour(AtsPlanWeek record);

    AtsPlanWeek findByIdFour(Integer weekId);

    int countIsvaTwo(Integer coachId);

    int selectMaxIsvaTwo(Integer coachId);


    /**
     * id查询运动员周计划关联表
     *
     * @param weekId
     * @return
     */
    List<AtsPlanWeek> weekOrAthleteById(Integer weekId);

    /**
     * 根据指定方案创建人查
     *
     * @param creater
     * @return
     */
    List<AtsPlanWeek> findIdTwo(String creater);

    /**
     * 根据创建人查计划
     *
     * @param creater
     * @return
     */
    AtsPlanWeek findById(String creater);

    /**
     * 当前教练员本周是否已经做过了计划
     *
     * @param week
     * @return
     */
    List<AtsPlanWeek> selectIsExists(AtsPlanWeek week);

    /**
     * 修改是否有效
     *
     * @param atsPlanWeek
     * @return
     */
    int updateIsva(AtsPlanWeek atsPlanWeek);

    /**
     * @mbg.generated 2019-10-29
     */
    int deleteByPrimaryKey(Integer weekId);

    /**
     * @mbg.generated 2019-10-29
     */
    int insert(AtsPlanWeek record);

    /**
     * @mbg.generated 2019-10-29
     */
    int insertSelective(AtsPlanWeek record);

    /**
     * @mbg.generated 2019-10-29
     */
    AtsPlanWeek selectByPrimaryKey(Integer weekId);

    AtsPlanWeek findMaxPid(int coachId);

    /**
     * @mbg.generated 2019-10-29
     */
    int updateByPrimaryKeySelective(AtsPlanWeek record);

    /**
     * @mbg.generated 2019-10-29
     */
    int updateByPrimaryKey(AtsPlanWeek record);
}